package com.example.qasys.entities;


import com.example.qasys.utils.OkHttpUtil;
import lombok.Data;
import okhttp3.Headers;
import okhttp3.Request;
import okhttp3.Response;

import javax.annotation.Resource;
import java.io.IOException;
import java.util.List;

@Data
public class CodyRequest {



//    public static String cookie = "intercom-device-id-vfclgirx=16cb9c44-3dc3-46c6-9906-55c959f1b8fb; remember_web_59ba36addc2b2f9401580f014c7f58ea4e30989d=eyJpdiI6InBsT1RlQmEzVkVoOVRXQTdyRU9iNkE9PSIsInZhbHVlIjoiYllGK0IzbWU4ZnVrTEJwamdTdW14Sm5ORHhQUUhyWUJZUFZWbUZXd29Udk8zOVFjd0FIT3RxbW5KakxyMjVNeXdUVUpxZi9iMFdzSDRLRFhDV2VRV2NETEhKZmxQUVF5ZXg5UlRUK2NzcmRJTmF0c0FubE81N25KWWtMZHlBZ1hIMVM2blZSZW4rUExMbTV2V01oQmpCeWt1R2h6VWZCQjlnODFTdVdmN3ZtNDhiaU9OaVlkbHUyRVdrMG5nT1IrbXRBZjMzMFlUcm9rY3R4aDZXZk1MelRtbEpHQjdpSWErUUh6MmpENUVKTT0iLCJtYWMiOiIwM2QwZjc5MjI2Y2M0YzQwZTQxNmUzMjRhNWVlNzBhMGE0Yzg0ZWI1YzA0YjE2ZDUwZDk2MzdkMjdkZTc1N2Q3IiwidGFnIjoiIn0%3D; intercom-session-vfclgirx=b3lrazRYUTBVUjExZlpDdlhhaDhqR2pHVFgzZlpBRnVYUWg3akh4T056QUdOaG5PTmRqQkswaGR5SWUrOU1XKy0tdnlMNzViWVBzNEJBOU1jUzhXM1c4dz09--532cf64bca9ea91d509616459a52be0c30678928; XSRF-TOKEN=eyJpdiI6ImtyUzAwMG8zejlIYVExbXVTWkQ2VkE9PSIsInZhbHVlIjoickFOUnAxU3E2bmVyT2dGSmxUbkhPNW5lbyswb21UN2U4ZFo4NEg1S2lZRlVJQkN5SlpReVQwMmpBelVBUXdOb09GNWJ5WThNVmdackVYRTBOM1RVM3BFZDVOaUo2R1VXR2ow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0s4emUvWjU3am1LcnQwdjJYaWYrWVlDOUI3bWU4T1VKWkl3SXp0NytIME52bkRENjFueEZQcnV0KzFjbEdvNUJxc1lqd2RXVHl3MXJEWENwQlJveHA4amVDcnZoSDF2RXpybFhXYTZwQnliaVlQRlRNV3RMNllLVUViejRWem1oM0tBZ1NNWnZya25INW9aakJ1dDRobm9qRXRLL0NvVkxtTTljN3ZyZkMyUzZNcXVIZ1M3dW5nNERtOU1SbGpJWm9ubFN1RkJEcXhSWEdTaS9wNGR3Y3g2dFFHOGtrSTFhdjVLM3A1aTdhbE5qeUZNSG1aIiwibWFjIjoiZjc4ZjczNmE2ZDY1MjI3YWQ4YTFlNmVhMzc0MGQ1ZTMzY2NjMDAwOGM3NTIzNTJiMmVjNmJjZDFlYmZhM2U4MiIsInRhZyI6IiJ9";

//    public static String token = "eyJpdiI6ImtyUzAwMG8zejlIYVExbXVTWkQ2VkE9PSIsInZhbHVlIjoickFOUnAxU3E2bmVyT2dGSmxUbkhPNW5lbyswb21UN2U4ZFo4NEg1S2lZRlVJQkN5SlpReVQwMmpBelVBUXdOb09GNWJ5WThNVmdackVYRTBOM1RVM3BFZDVOaUo2R1VXR2owS21oeHZld1pTV0Mvc0FzMGJMM2M2NVNXUGcxYTgiLCJtYWMiOiIzZTUxYzNhY2YzYmVkM2ZjMDg1YjFiZTk3ZDI5NmU1ZWQwYjUzZjNiMjdhNGMxMDJhMmQ0M2VhNTBmODA4YTlkIiwidGFnIjoiIn0=";


//    public static String url = "https://getcody.ai/web/messages?conversation_id=8729&page=1&per_page=50&includes=contextDocuments,user";

    public static String cookie="intercom-device-id-vfclgirx=16cb9c44-3dc3-46c6-9906-55c959f1b8fb; remember_web_59ba36addc2b2f9401580f014c7f58ea4e30989d=eyJpdiI6InBsT1RlQmEzVkVoOVRXQTdyRU9iNkE9PSIsInZhbHVlIjoiYllGK0IzbWU4ZnVrTEJwamdTdW14Sm5ORHhQUUhyWUJZUFZWbUZXd29Udk8zOVFjd0FIT3Rx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yc29WIiwibWFjIjoiNjcxYmE5YTVhODk5N2I0ZTU4YWJkZTgwOWViMmFmZWI2MzFkM2I4YjZlNTNiMTIxNDMzYjI1MzYxOTljMzU1NCIsInRhZyI6IiJ9";
    public static String token ="eyJpdiI6ImpCM09rK1N2T294U1lxZTBMd1VwU0E9PSIsInZhbHVlIjoiQ3NSLzhSdnR1R052dExDa1dRSVBCQmxRc29vbktDU3BDTlloZTJCeWkrTGxuc3I1eENXT3RNUkJ5M2JLc1FqYU9Sdkg4dVFLTnlBVjY3ekFhbU5ZYnJzcy9wbys2SnhDNktEQmlCdTN0QzJ5bHZXcmpLL3pvRWJGY2Q4MngyLzEiLCJtYWMiOiJkNjZmYmMwNWJlN2UwNzllMGVkYzFjZjlkMzczMTVkYzZiYjEzMGE2NWRhOGJiYzFiYWQ1ZTIzN2U0MGUwYTRlIiwidGFnIjoiIn0=";

    public  Headers getCodyRequestHead(){
        Headers headers = new Headers.Builder()
                .add("authority","getcody.ai")
                .add("accept","application/json, text/plain, */*")
                .add("accept-language","zh-CN,zh;q=0.9,zh-TW;q=0.8")
                .add("content-type","application/json")
                .add("cookie",cookie)
                .add("origin","https://getcody.ai")
                .add("referer","https://getcody.ai/conversations/8729")
                .add("sec-ch-ua","\"Chromium\";v=\"110\", \"Not A(Brand\";v=\"24\", \"Google Chrome\";v=\"110\"")
                .add("sec-ch-ua-mobile","?0")
                .add("sec-ch-ua-platform","\"Windows\"")
                .add("sec-fetch-dest","empty")
                .add("sec-fetch-mode","cors")
                .add("sec-fetch-site","same-origin")
                .add("user-agent","Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Mobile Safari/537.36")
                .add("x-xsrf-token", token)
                .build();
        return headers;
    }

    public void setCookieAndToken(String cookie,String token){
        this.cookie = cookie;
        this.token = token;
    }
}
